home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / lpmac1.arc / MSDOS.MLB < prev    next >
Text File  |  1987-02-26  |  6KB  |  195 lines

  1. ;
  2. ;    This is    file: MSDOS.MLB.
  3. ;
  4. ;    It is an include library file containing constant
  5. ;    declarations which are for use with Seattle Computer
  6. ;    Products MS-DOS    operating system.
  7. ;
  8. ;-------------------------------------------------------------------
  9. ;
  10.     .XCREF
  11. ;
  12. ;    MS-DOS interrupt types:
  13. ;
  14. ABORT        EQU    020H    ;Program abort.    
  15. FUNCTIONREQUEST    EQU    021H    ;Operating system function request.
  16. RETURNADDRESS    EQU    022H    ;Return    address    for called program.
  17. CONTROLCEXIT    EQU    023H    ;Address called    on a CTRL-C.
  18. FATALERROREXIT    EQU    024H    ;Address called    on a fatal error.
  19. ABSOLUTEREAD    EQU    025H    ;Direct    call to    I/O system read.
  20. ABSOLUTEWRITE    EQU    026H    ;Direct    call to    I/O system write.
  21. STAYRESIDENT    EQU    027H    ;Exit but stay resident.
  22. ;
  23. ;    MS-DOS function    types:
  24. ;
  25. TERMINATE    EQU    000h    ;Program termination.
  26. CONSOLEINPUT    EQU    001h    ;Get a console character.
  27. CONSOLEOUTPUT    EQU    002h    ;Print a console character.
  28. AUXILIARYINPUT    EQU    003h    ;Get char from auxiliary port.
  29. AUXILIARYOUTPUT    EQU    004h    ;Put char out to auxiliary port.
  30. PRINTEROUTPUT    EQU    005h    ;Put char out to printer port.
  31. DIRECTCONSOLEIO    EQU    006h    ;Do direct console I/O.
  32. ;
  33. OUTPUTSTRING    EQU    009h    ;Output    a string onto console.
  34. INPUTSTRING    EQU    00ah    ;Input a string    from console.
  35. CONSOLESTATUS    EQU    00bh    ;Check console status.
  36. ;
  37. DISKSYSTEMRESET    EQU    00dh    ;Flushes all file buffers.
  38. SETDEFAULTDRIVE    EQU    00eh    ;Select    default    disk drive.
  39. OPENFILE    EQU    00fh    ;Open MS-DOS disk file.
  40. CLOSEFILE    EQU    010h    ;Close MS-DOS disk file.
  41. SEARCHFIRSTFILE    EQU    011h    ;Search    directory for matching file.
  42. SEARCHNEXTFILE    EQU    012h    ;Search    directory for matching file.
  43. DELETEFILE    EQU    013h    ;Delete    MS-DOS disk file.
  44. SEQUENTIALREAD    EQU    014h    ;Read next disk    file record.
  45. SEQUENTIALWRITE    EQU    015h    ;Write next disk file record.
  46. CREATEFILE    EQU    016h    ;Create    MS-DOS disk file.
  47. RENAMEFILE    EQU    017h    ;Rename    MS-DOS disk file.
  48. ;
  49. GETDEFAULTDRIVE    EQU    019h    ;Get default disk drive.
  50. SETDMAADDRESS    EQU    01ah    ;Set disk I/O address.
  51. ALLOCATIONTABLE    EQU    01bh    ;Get current drive allocation table.
  52. ;
  53. DISKPARAMETERS    EQU    01fh    ;Get parameters    for current disk.
  54. ;
  55. RANDOMREAD    EQU    021h    ;Read a    random disk file record.
  56. RANDOMWRITE    EQU    022h    ;Write a random    disk file record.
  57. GETFILESIZE    EQU    023h    ;Get MS-DOS disk file size.
  58. GETFILEADDRESS    EQU    024h    ;Set random record to current.
  59. SETVECTOR    EQU    025h    ;Set interrupt vector.
  60. CREATESEGMENT    EQU    026h    ;Create    a segment.
  61. RANDOMBLKREAD    EQU    027h    ;Read multiple records random.
  62. RANDOMBLKWRITE    EQU    028h    ;Write multiple    records    random.
  63. PARSEFILENAME    EQU    029h    ;Parse MS-DOS disk file    name.
  64. GETCURRENTDATE    EQU    02ah    ;Get the current date.
  65. SETCURRENTDATE    EQU    02bh    ;Set the current date.
  66. GETCURRENTTIME    EQU    02ch    ;Get the current time.
  67. SETCURRENTTIME    EQU    02dh    ;Set the current time.
  68. SETVERIFYFLAG    EQU    02eh    ;Set disk I/O system verify flag.
  69. getdmaaddress    equ    02fh    ;Get disk transfer address.
  70. getdosversion    equ    030h    ;Get the dos version number.
  71. ;
  72. handle_open    equ    03dh
  73. handle_close    equ    03eh
  74. handle_read    equ    03fh
  75. handle_write    equ    040h
  76. handle_io_ctrl    equ    044h
  77. setblock    equ    04ah    ;Set memory block size.
  78. execprogram    equ    04bh    ;Load or execute program.
  79. findmatchfile    equ    04eh    ;Find matching files.
  80. nextmatchfile    equ    04fh    ;Next matching files.
  81. ;
  82. FCB_DSECT    STRUC
  83.  
  84. DRIVECODE    DB    ZERO
  85. FILENAME    DB    '        '
  86. EXTENSION    DB    '   '
  87. CURRENTBLOCK    DW    ZERO
  88. RECORDSIZE    DW    ZERO
  89. FILESIZE    DD    ZERO
  90. FILEDATE    DW    ZERO
  91. FILETIME    DW    ZERO
  92.         DB    8 DUP (ZERO)
  93. CURRENTRECORD    DB    ZERO
  94. RANDOMRECORD    DD    ZERO
  95.  
  96. FCB_DSECT    ENDS
  97. ;
  98. DIR_DSECT    STRUC
  99.  
  100.         DB    ZERO        ;Drive
  101.         DB    '        '    ;Name
  102.         DB    '   '        ;Extenstion
  103. DIRATTRIBUTES    DB    ZERO
  104.         DB    10 DUP (ZERO)
  105. DIRTIME        DW    ZERO
  106. DIRDATE        DW    ZERO
  107. DIRFIRSTUNIT    DW    ZERO
  108. DIRSIZE        DD    ZERO
  109.  
  110. DIR_DSECT    ENDS
  111. ;
  112. ALTERNATEFCB    EQU    FILESIZE
  113. ;
  114. DATE_DSECT    RECORD    YEAR:7=0,MONTH:4=0,DAY:5=0
  115. ;
  116. TIME_DSECT    RECORD    HOUR:5=0,MINUTE:6=0,SECOND:5=0
  117. ;
  118. LINE_DSECT    STRUC
  119.  
  120. LINEMAXIMUM    DB    ?
  121. LINELENGTH    DB    ?
  122. LINEDATA    DB    ?
  123.  
  124. LINE_DSECT    ENDS
  125. ;
  126. FILENAMELENGTH    EQU    OFFSET EXTENSION-OFFSET    FILENAME
  127. EXTENSIONLENGTH    EQU    OFFSET CURRENTBLOCK-OFFSET EXTENSION
  128. FCBLENGTH    EQU    SIZE FCB_DSECT    ;Length    of an FCB.
  129. ;
  130. filespeclength    equ    byte+filenamelength+extensionlength
  131. LASTPARAGRAPH    EQU    00002H    ;Pointer to last memory    paragraph + 1.
  132. LASTADDRESS    EQU    00006H    ;Program segment size.
  133. environment    equ    00002ch    ;Address of segment of environment.
  134. PROGRAMPARAM1    EQU    00005CH    ;Address of first parameter.
  135. PROGRAMPARAM2    EQU    00006CH    ;Address of second parameter.
  136. PROGRAMPARAMS    EQU    000080H    ;Address of unformated parameters.
  137. ;
  138. DEFAULTDMABUF    EQU    000080H    ;Address of default DMA    buffer.
  139. ;
  140. PROGRAMSTART    EQU    000100H    ;Program start address.
  141. ;
  142. PRINTSTRINGEND    EQU    '$'    ;Delimiter for print string.
  143. SEQUENTIALEOF    EQU    001H    ;Returned in AL    for EOF.
  144. SEQUENTIALFULL    EQU    001H    ;Returned in AL    when disk is full.
  145. DOSERRORFLAG    EQU    0FFH    ;Used for indicating errors.
  146. DEFAULTDMALEN    EQU    080H    ;Size of default DMA buffer.
  147. ENDOFFILECHAR    EQU    01AH    ;Control Z.
  148. ;
  149. read_only    equ    001h
  150. hidden        equ    002h
  151. system        equ    004h
  152. volume_id    equ    008h
  153. directory    equ    010h
  154. archive        equ    020h
  155. ;
  156. OPEN_FOR_READ        EQU    000H    
  157. OPEN_FOR_WRITE        EQU    001H
  158. OPEN_FOR_BOTH        EQU    002H
  159. ;
  160. HANDLE_GET_INFO        EQU    000H
  161. HANDLE_SET_INFO        EQU    001H
  162. HANDLE_READ_CTRL    EQU    002H
  163. HANDLE_WRITE_CTRL    EQU    003H
  164. DRIVE_READ_CTRL        EQU    004H
  165. DRIVE_WRITE_CTRL    EQU    005H
  166. HANDLE_READ_STATUS    EQU    006H
  167. HANDLE_WRITE_STATUS    EQU    007H
  168. ;
  169. find_buf    struc
  170.  
  171. find_buf_reserved    db    21 dup (?)    ;Reserved for MS-DOS.
  172. find_buf_attr        db    ?        ;Attribute found.
  173. find_buf_time        db    ?        ;Time for file.
  174. find_buf_date        db    ?        ;Date for file.
  175. find_buf_size        dd    ?        ;Size of file.
  176. find_buf_fill        dw    ?        ;Who knows?
  177. find_buf_pname        db    13 dup (?)    ;Packed name.
  178.  
  179. find_buf    ends
  180. ;
  181. DOSCALL    MACRO    CALLTYPE,ADDRESS
  182.     IFNB    <ADDRESS>
  183.     MOV    DX,OFFSET ADDRESS
  184.     ENDIF
  185.     IFNB    <CALLTYPE>
  186.     MOV    AH,CALLTYPE
  187.     ENDIF
  188.     INT    FUNCTIONREQUEST
  189.     ENDM
  190. ;
  191.     .CREF
  192. ;
  193.  
  194.  
  195.